Skip to content

Conversation

@vlad-perevezentsev
Copy link
Contributor

@vlad-perevezentsev vlad-perevezentsev commented Nov 14, 2025

This PR removes the remaining wildcard imports and __all__ declarations from internal modules and consolidates the corresponding exports in dpnp/__init__.py as part of the ongoing public API unification.

This work follows #2665.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@github-actions
Copy link
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2666/index.html

@github-actions
Copy link
Contributor

Array API standard conformance tests for dpnp=0.20.0dev0=py313h509198e_69 ran successfully.
Passed: 1229
Failed: 0
Skipped: 7

* Redesigned `dpnp.modf` function to be a part of `ufunc` and `vm` pybind11 extensions [#2654](https://github.com/IntelPython/dpnp/pull/2654)
* Refactored `dpnp.fft` and `dpnp.random` submodules by removing wildcard imports and defining explicit public exports [#2649](https://github.com/IntelPython/dpnp/pull/2649)
* Added support for the `out` keyword to accept a tuple, bringing ufunc signatures into alignment with those in NumPy [#2664](https://github.com/IntelPython/dpnp/pull/2664)
* Unified `dpnp` public API exports by consolidating function exports in `__init__.py` and removing wildcard imports [#2665](https://github.com/IntelPython/dpnp/pull/2665) [#2666](https://github.com/IntelPython/dpnp/pull/2666)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove "--disable=c-extension-no-member" from .pre-commit-config.yaml now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And E501 skipping in .flake8

Comment on lines +131 to +138
from .dpnp_iface_types import (
e,
euler_gamma,
inf,
nan,
newaxis,
pi,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to be a part of the below Routines

)

# -----------------------------------------------------------------------------
# Constants (borrowed from NumPy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Constants (borrowed from NumPy)
# Constants

Comment on lines +84 to +85
# The order of these declarations are borrowed from the NumPy document:
# https://numpy.org/doc/stable/reference/arrays.scalars.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not really make any sense, because there is a single from .dpnp_iface_types import below which is connected with that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order is defined by the python sort linter and not by the pointing numpy's page.

# -----------------------------------------------------------------------------
# Type-related helper functions
# -----------------------------------------------------------------------------
from .dpnp_iface_types import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a part of Data type routines from https://numpy.org/doc/stable/reference/routines.dtype.html.
Why isn't it moved below to the routines?

iinfo,
isdtype,
issubdtype,
is_type_supported,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That needs to be moved away. It's a kind of deprecated API which we should not expose.
Probably it would be better to move that to dpnp/random/dpnp_iface_random.py (where it is only used) and to make it an internal function.

# -----------------------------------------------------------------------------
from .dpnp_iface_types import (
common_type,
finfo,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to move dtype here instead of the above line#97 ?

isdtype,
issubdtype,
is_type_supported,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems result_type has be a part of that block, if we are following the routines page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And can_cast also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants